"use strict";

Object.defineProperty(exports, "__esModule", {
    value: true
});
var genOnceRun = exports.genOnceRun = function genOnceRun(fn) {
    var runFlag = false;
    var rst = void 0;
    var onceRun = function onceRun() {
        if (runFlag) {
            return rst;
        }
        runFlag = true;

        for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
            args[_key] = arguments[_key];
        }

        return rst = fn.call.apply(fn, [this].concat(args));
    };
    var reset = function reset() {
        runFlag = false;
    };
    onceRun.reset = reset;
    return onceRun;
};
exports.default = genOnceRun;